From db7915ec5102856c1fa4e4c2493866de1b18aae7 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Tue, 22 Jul 2008 17:41:39 +0000 Subject: [PATCH] Don't use RandR 1.2 if driver is detected as randr12_compat (ie X driver 2008-07-22 Frederic Crozat * gdk/x11/gdkscreen-x11.c: Don't use RandR 1.2 if driver is detected as randr12_compat (ie X driver is not RandR 1.2 compliant). Fixes multihead with such drivers. Bug #543317. svn path=/trunk/; revision=20893 --- ChangeLog | 7 +++++++ gdk/x11/gdkscreen-x11.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index a566439ca5..48a319cbd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-22 Frederic Crozat + + * gdk/x11/gdkscreen-x11.c: Don't use RandR 1.2 + if driver is detected as randr12_compat (ie X driver + is not RandR 1.2 compliant). Fixes multihead with + such drivers. Bug #543317. + 2008-07-21 Matthias Clasen * configure.in: Default to linking against Xinerama again, diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 624d1901e0..0fb700591d 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -674,6 +674,7 @@ init_randr12 (GdkScreen *screen) XRRScreenResources *resources; int i; GArray *monitors; + gboolean randr12_compat = FALSE; if (!display_x11->have_randr12) return FALSE; @@ -691,6 +692,9 @@ init_randr12 (GdkScreen *screen) XRROutputInfo *output = XRRGetOutputInfo (dpy, resources, resources->outputs[i]); + /* Non RandR1.2 X driver have output name "default" */ + randr12_compat |= !g_strcmp0(output->name, "default"); + if (output->crtc) { GdkX11Monitor monitor; @@ -718,6 +722,13 @@ init_randr12 (GdkScreen *screen) XRRFreeScreenResources (resources); + /* non RandR 1.2 X driver doesn't return any usable multihead data */ + if (randr12_compat) + { + g_array_free (monitors, TRUE); + return FALSE; + } + screen_x11->n_monitors = monitors->len; screen_x11->monitors = (GdkX11Monitor *)g_array_free (monitors, FALSE); -- 2.30.2